package com.zhu.androidsample.util;

import android.content.Context;
import android.widget.Toast;

/**
 * Created by ZCP on 2015/11/17.
 * mail:43426073@qq.com
 */
public class ToastUtil {

    static Toast toast;
    static Context context;

    public static void initToastUtil(Context mContext) {
        context = mContext;
        toast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
    }


    public static void show(String message) {
        if (toast == null) {
            throw new RuntimeException("initToastUtil() method must be called before use!");
        }
        toast.setText(message);
        toast.show();
    }

}
